Skip to content

gracefully handle null within 'stripControls', #906#907

Open
ThrawnCA wants to merge 3 commits intoESAPI:developfrom
ThrawnCA:github-906-null-setheader
Open

gracefully handle null within 'stripControls', #906#907
ThrawnCA wants to merge 3 commits intoESAPI:developfrom
ThrawnCA:github-906-null-setheader

Conversation

@ThrawnCA
Copy link

@ThrawnCA ThrawnCA commented Feb 5, 2026

No description provided.

@jeremiahjstacey
Copy link
Collaborator

@ThrawnCA
It would be greatly appreciated if you could also add a test in the StringUtilitiesTest for strip controls.
There appear to be no tests for this method in that class currently.

Bare minimum would be a simple validation that when null is provided, null is returned. If you're willing and able to provide more case coverage that would certainly be beneficial, but beyond the scope of this change.

Thank you for the contributions to the project.

- Check valid string, control characters, empty string, whitespace, and null
@ThrawnCA
Copy link
Author

ThrawnCA commented Feb 6, 2026

@ThrawnCA It would be greatly appreciated if you could also add a test in the StringUtilitiesTest for strip controls. There appear to be no tests for this method in that class currently.

Done.

I notice that this project seems unready for Java 17. It fails module access checks. Also, several tests within EncryptedUtilsPropertiesTest fail because Properties.store attempts to call ReferenceEncryptedProperties.entrySet, which is specifically disallowed.

FYI In order to make the Surefire plugin run successfully (apart from EncryptedPropertiesUtilsTest), I updated its configuration locally to:

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-surefire-plugin</artifactId>
    <version>${version.surefire}</version>
    <configuration>
        <argLine>
            --add-opens java.base/java.lang=ALL-UNNAMED
            --add-opens java.base/java.util=ALL-UNNAMED
            --add-opens java.base/java.util.regex=ALL-UNNAMED
            --add-opens java.base/java.text=ALL-UNNAMED
            --add-opens java.logging/java.util.logging=ALL-UNNAMED
        </argLine>
    </configuration>
</plugin>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants